<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="msapplication-window" content="width=device-width;height=device-height">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>主题</title>
<link rel="stylesheet" href="../css/common/jquery.mobile-1.4.5.min.css">
<link type="text/css" rel="stylesheet" charset="utf-8" href="../plugins/bootstrap/css/bootstrap.min.css">

<link rel="stylesheet" href="../css/common/weui.min.css">
<link rel="stylesheet" href="../css/common/jquery-weui.min.css">
<link rel="stylesheet" href="../css/common/unslider.css">
<link rel="stylesheet" href="../css/theme.css">
<link rel="stylesheet" href="../css/base.css">

<script src="../js/common/jquery-2.0.0.js"></script>
<script src="../js/common/jquery.mobile-1.4.5.js"></script>
<script src="../js/common/velocity.min.js"></script>
<script src="../js/common/jquery.event.move.js"></script>
<script src="../js/common/jquery.event.swipe.js"></script>
<script src="../js/common/unslider-min.js"></script>

<script src="../js/common/yxMobileSlider.js"></script>
<!--
	作者：wyy8@live.cn
	时间：2017-06-06
	描述：微信
-->
<script type="application/javascript" src="../js/common/jweixin-1.0.0.js"></script>
<script type="application/javascript" src="../js/common/jquery-weui.min.js"></script>

<script src="../js/ajax_req.js"></script>
<script src="../js/api.js"></script>
<script src="tmpl/theme_loadmore.js"></script>


<script src="tmpl/theme.js"></script>
<!--模板-->
<script type="application/javascript" src="../plugins/jquery-tmpl/jquery.tmpl.js"></script>
<script type="application/javascript" src="../plugins/jquery-tmpl/jquery-jtemplates.js"></script>

</head>
<body style="overflow: hidden;">
	<div data-role="page" id="toppage">
		<div id="sds">
			<div class="slider">
			  <ul id="ul-slider">
			  </ul>
			</div>
		</div>
		
		<div class="theme_introduce">
		</div>
		<div class="down_more">
			<img src="../image/down.png" style="width: 1.75rem;height: 1rem;" onclick="moreClick(this)">
		</div>
		
		<div id="box">
			
		</div>
	</div>
	
	<div data-role="footer" data-position="fixed" class="foot-div">
        <div class="gouwuche_content" onclick="goHome()">
        	<span class="gouwuche_icon" style="margin-left: -2px;"><img src="../image/jx_s.png" width="20px"></span>
        	<a href="#" data-icon="shop" style="color: #347B00;">精选</a>
        </div>
        
        <div class="gouwuche_content">
        	<span class="gouwuche_icon" style="margin-left: -2px;"><img src="../image/ms_us.png" width="20px"></span>
        	<a href="#" data-icon="shop">秒杀</a>
        </div>
        
        <div class="gouwuche_content" onclick="myShopping()">
        	<span class="gouwuche_icon" style="margin-left: 1rem;">
        		<img src="../image/wd_us.png" width="20px">
        		<span class="badge"></span>
        	</span>
        	<a href="#" data-icon="star">我的鱼篓</a>
        	
        </div>
        
        <div class="gouwuche_content" onclick="memberClick()">
        	<span class="gouwuche_icon" style="margin-left: 1rem;"><img src="../image/hy_us.png" width="20px"></span>
        	<a href="#">会员中心</a>
        </div>
        
    </div>
</body>

<script>
	var setHeight = function(e){
		console.log($(e).height())
		//$("#hot_goods .banner").height($(e).height()); 
	}

	$("#toTop").click(function(){
		 document.documentElement.scrollTop = document.body.scrollTop =0;
	})
	
	var id = parseInt(getQueryString("id"))
	ajax(api.getThemeDetail, {id:id}, function(data){
		console.log("getThemeDetail : ",data)
		//banner
		if(data.theme != null && data.theme.atlas != null){
			var list_img = data.theme.atlas.split(",")
			for(var i=0;i<list_img.length;i++){
				$(".slider ul").append("<li><img onload=\"img_onload(this)\" src=\""+list_img[i]+"\"></li>")
			}
			$(".slider").yxMobileSlider({width:window.screen.width,during:3000,height:window.screen.width*175/375})
		}
		
		$(".theme_introduce").text(data.theme.introduce)
		
		/*$("#box").setTemplateURL('tmpl/theme.html');
		$("#box").setParam("width", window.screen.width); 
		$("#box").processTemplate(data);*/
		$('#box').load("comm/loadmore.html", function(data){
			loaded(0, {url:api.getThemeDetail, page:'tmpl/theme.html', para:{id:id}})
		});
		//购物车图标更改
		gouwuche_changed()
	})
	
	//购物车图标更改
	function gouwuche_changed(){
		ajax(api.getCartItemNum, {}, function(data){
			if(data != null && data.num != null && data.num != 0){
				if(data.num>99){
					//$(".badge").text("99+")
				}else if(data.num>9){
					//$(".badge").text(data.num)
				}else{
					//$(".badge").text(data.num)
				}
				$(".badge").css("display","block")
			}else{
				$(".badge").css("display","none")
			}
		})
	}
	
	//图片加载
    function img_onload(obj){
		obj.width=window.screen.width
	}
    
    //gotop
	function gotop(){
		$('#toppage').animate({scrollTop:0},500);
		 return false;
	}
	
	function memberClick(){
    	window.location.href="http://cs.tzfwzx.cn/fishing/site/user/index"
    }
</script>
</html>